//
//  HMShopViewController.m
//  G05爱鲜蜂
//
//  Created by 曹魏 on 16/10/20.
//  Copyright © 2016年 何源. All rights reserved.
//
#import "PayTableViewController.h"
#import "HMPayTableView.h"
#import "HMTableFootView.h"
#import "Masonry.h"

@interface PayTableViewController ()
@property (nonatomic,strong) HMPayTableView *payTableView;
@property (nonatomic, strong) HMTableFootView *footView;

@end

@implementation PayTableViewController

-(HMPayTableView *)payTableView{
    if (_payTableView == nil) {
        _payTableView = [[HMPayTableView alloc]init];
        
    }
    return _payTableView;
}

-(HMTableFootView *)footView{
    if (_footView == nil) {
        _footView = [[HMTableFootView alloc]init];
    }
    return _footView;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    UIBarButtonItem *left = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"v2_goback"] style:UIBarButtonItemStylePlain target:self action:@selector(back)];
    self.navigationItem.leftBarButtonItem = left;
    left.tintColor = [UIColor grayColor];
    
    [self setupSubviews];
    self.title = @"结算付款";
}
- (void)back {
    [self.navigationController popViewControllerAnimated:YES];
//    NSLog(@"点击返回");
}

-(void)setupSubviews {
    
    [self.view addSubview:self.footView];
    self.footView.money.text = @"总共金额:$500";
    [self.footView.commitBtn setTitle:@"确认付款" forState:UIControlStateNormal];
    [self.footView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(self.view);
        make.height.equalTo(@50);
    }];
    
    
    [self.view addSubview:self.payTableView];
    [self.payTableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.left.equalTo(self.view);
        make.top.equalTo(self.view).offset(64);
        make.bottom.equalTo(self.footView.mas_top);
        
    }];
    
}


@end
